SoftwareConverter

Turns a decoded CPU-readable frame into tightly packed RGBA on JVM and Android.

KiteFFmpeg removes every source-row padding byte while copying, so the shared conversion kernel derives its offsets and strides from the declared format. The native actual keeps its zero-copy plane reads; this actual deliberately performs the one unavoidable JNI-to-Kotlin copy exactly once.

Types

Link copied to clipboard
class Buffers

The two arrays one renderer reuses from frame to frame. Use one instance from one thread at a time.

Functions

Link copied to clipboard
fun toneMapsHdr(colorSpace: ERROR CLASS: Symbol not found for ColorSpaceInfo): Boolean

Whether toRgba will roll a frame with this colour off to SDR.

Link copied to clipboard

Converts frame to width * height * 4 RGBA bytes with no row padding.

toRgba with both of its arrays taken from buffers: the planes copied out of KiteFFmpeg, and the RGBA bytes. A renderer that keeps one Buffers allocates neither array again until the frame size changes. The returned array belongs to buffers, and the next call with the same buffers overwrites it.

toRgba into reuse when it is exactly width * height * 4 bytes, and into a new array otherwise. A renderer that passes back the array it got for the previous frame allocates the RGBA bytes once instead of once per frame. It must be done with that array first: the bytes are overwritten in place.